<!--
	vLoginSample
-->
<?php
	/***************************************************
	 * View Declaration
	 ***************************************************/

		$formOption01 = sprintf('/%s/%s/',$this->nUri['seg1'],$this->nUri['loginSeg']);
		$formOption02 = array(
			'role' => 'form',
			'id' => 'nForm',
			'class' => 'nForm form-signin'
		);

?><?php
	/***************************************************
	 * View Output
	 ***************************************************/
?>
		<?=$this->nhtml->nFormOpen($formOption01, $formOption02)?>
			<h2 class="form-signin-heading">루비오라 로그인</h2>
			<input type="text" name="<?=$this->nurl->encrypt('uq_member_id')?>" class="form-control nValidation uIdUserId borderr1" placeholder="아이디" autofocus>
			<input type="password" name="<?=$this->nurl->encrypt('pw_member_pw')?>" class="form-control nValidation borderr1" placeholder="패스워드">
			<label class="checkbox">
				<input type="checkbox" name="<?=$this->nurl->encrypt('ck_remember')?>" class="uIdRemeberMe" value="y"> 나의 정보 기억
			</label>
			<a href="javascript:void(0);" class="btn uIdBtnConfirm01  btn-lg btn-primary btn-block" type="submit">로그인</a>
		<?=$this->nhtml->nFormClose()?>
<?php
	/***************************************************
	 * View Ajax
	 ***************************************************/
?>
		<script type="text/javascript">
			var postValue = {};

			$(function(){
				postValue['GAesKey'] = GAesKey;
				$('.uIdBtnConfirm01').click(function(){
					var targetButton = $(this);
					$(targetButton).addClass('disabled');
					var formAjaxSendPref = {
						oForm : '#nForm',
						mode : '<?=$this->nurl->encrypt("retrive")?>',
						nameValues : [
							'<?=$this->nurl->encrypt("uq_member_id")?>',
							'<?=$this->nurl->encrypt("pw_member_pw")?>',
							'<?=$this->nurl->encrypt("ck_remember")?>'
						],
						afterCallback:function(data){
							//console.log($(this));
							if(data.process == 'validation' && data.resultMessage == 'fail'){
								bootbox.alert('올바른 로그인 정보를 입력 하세요.', function(){
									$(targetButton).removeClass('disabled');
									return;
								});
							}
							if(data.process == 'loginCheck' && data.resultMessage == 'fail'){
								bootbox.alert('아이디가 존재하지 않거나, 비밀번호가 올바르지 않습니다.', function(){
									$(targetButton).removeClass('disabled');
									return;
								});
							}
							if(data.process == 'loginCheck' && data.resultMessage == 'succ'){
								bootbox.alert('로그인 되었습니다.', function(){
									$(targetButton).removeClass('disabled');
									return;
								});
							}
						}
					};
					Najax.init(formAjaxSendPref);
					Najax.call();
				});
			});
		</script>

		<?php if(@$this->input->cookie('ck_uId') != ''):?>
			<script type="text/javascript">
				$(function(){
					$('.uIdRemeberMe').attr("checked","true");
					$('.uIdUserId').val('<?=@$this->input->cookie("ck_uId")?>');
				});
			</script>
		<?php endif;?>